﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>离退员工记录</title>
    <!--link to style-->
    <link rel="stylesheet" href="css/adapt.css" />
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../../static/css/font-awesome.min.css" />
    <!--<link rel="stylesheet" href="css/adapt.css" />-->
    <!--//End link to style-->
    <script type="text/javascript" src="../js/jquery.js"></script>
</head>
<body>
    <div class="Body clearfix">
        <div class="catlog">
            <span class="cat_block">当前位置</span>
            <span class="cat_block icon-chevron-right">离退员工记录</span>
            <span class="cat_block icon-chevron-right">查看离退员工记录</span>
        </div>
        <table class="table">
            <tr class="fir_tit">
                <td class="firline">员工号</td>
                <td class="firline">姓名</td>
                <td class="firline">添加时间</td>
                <td class="firline">工作变动</td>
                
            </tr>
            <!-- <tr class="lineTr">
                <td class="reguLine">001</td>
                <td class="reguLine">admin</td>
                <td class="reguLine">2018/01/01</td>
                <td class="reguLine">在职</td> 
                <td class="reguLine"><a href="resetStatus.html"><span class="icon-pencil span"></span></a></td>
            </tr>
 			-->

        </table>

    </div>



    <script>
        $(function () {

        	$.ajax({
                type: "Post",
                url: "/hr_doc/servlet/SituationServlet",
                data: {
               	 Command:"list",
                },
                async: false,
                dataType: "json",
                success: function (d) {
					console.log(d);
	               	if(d.code == 1){
						
	               		var result = d.result;
	               		var str = "";
	               		for(var i = 0;i<result.length;i++){
	               			var item = result[i];
	               			
	               			str += '<tr class="lineTr">';
	               			str += '<td class="reguLine">'+item.sno+'</td>';
	               			str += '<td class="reguLine">'+item.sname+'</td>';
	               			str += '<td class="reguLine">'+item.addtime+'</td>';
	               			var statusname = '';
	                        switch(item.operat){
	                        case 0:
	                        	statusname = '在职';
	                        	break;
	                        case 1:
	                        	statusname = '离职';
	                        	break;
	                        case 2:
	                        	statusname = '退休';
	                        	break;
	                        case 3:
	                        	statusname = '停职';
	                        	break;
	                        case 4:
	                        	statusname = '休假';
	                        	break;
	                       default:
	                        	statusname = '未知';
	                        	break;
	                        }
	               			str += '<td class="reguLine">'+statusname+'</td>';
	               			
	               			str += '</tr>';
	               		}
	               		$(".table").append(str);
	               	}
                },
                error: function (xmlHttpRequest, textStatus, errorThrown) {
                	location.href = "/hr_doc/login.html";
                }
            });	
        	
        })
    </script>
</body>
</html>